﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Oracle.DataAccess.Client;
using System.Configuration;
using System.Data;
namespace PaydSystem
{
    public partial class WebForm1 : System.Web.UI.Page
    {

        // map  sting  textbox
     //   string userId = name.Text.ToString();
        
         string strConnectString = ConfigurationManager.ConnectionStrings["PAYDDB"].ConnectionString;
        protected void Page_Load(object sender, EventArgs e)
        {
          

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            OracleConnection conn = new OracleConnection(strConnectString);

            conn.Open();
            string sql = "select name from payd_user where USER_ID= :user_id_st"; // C#
            OracleCommand cmd = new OracleCommand(sql, conn);
            cmd.CommandType = CommandType.Text;

            cmd.Parameters.Add(new OracleParameter("@user_id_st", user_id.Text));
           
            OracleDataReader dr = cmd.ExecuteReader(); // C#
            dr.Read();

            name.Text = dr["name"].ToString(); // C# retrieve by column name
           // name.Text = dr.GetString(0).ToString();  // return a .NET data type
          //  name.Text = dr.GetOracleString(0).ToString();  // return an Oracle data type
            conn.Close();   // C#

            conn.Dispose(); 
        }
    }
}